CDGetSimilarity
Your component receives theCDGetSimilarity
request whenever an application calls the Image Compression Manager'sGetSimilarity
function. Your component compares the specified compressed image to a picture stored in a pixel map and returns a value indicating the relative similarity of the two images.
- Note
- The
CDGetSimilarity
function is optional. If your component doesn't support it, it should return thecodecUnimpError
result code.
pascal ComponentResult CDGetSimilarity (PixMapHandle src, const Rect *srcRect, ImageDescriptionHandle desc, Ptr data, Fixed *similarity);
src
- Contains a handle to the noncompressed image. The image is stored in a pixel map structure.
srcRect
- Contains a pointer to a rectangle defining the portion of the image to compare to the compressed image.
desc
- Contains a handle to the image description structure that defines the compressed image for the operation.
data
- Contains a pointer to the compressed image data.
similarity
- Contains a pointer to a field that is to receive the similarity value. Your component sets this field to reflect the relative similarity of the two images. Valid values range from 0 (key frame) to 1 (identical).
DESCRIPTION
If the source image has been temporally compressed and is not a key frame (that is, the image relies on other frames that are not available to your component at this time), your component should return a result value ofparamErr
.Only decompressors receive this request.
RESULT CODES
noErr 0 No error paramErr -50 Invalid parameter specified memFullErr -108 Not enough memory available codecUnimpError -8962 Feature not implemented by this compressor
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help